#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
using pll = pair<ll, ll>;

int n, m;
struct Sx {
  ll x, y;
  bool operator<(Sx o) const {
    if (x != o.x) return x < o.x;
    return y < o.y;
  }
} a[N];
struct Sy {
  ll x, y;
  bool operator<(Sy o) const {
    if (y != o.y) return y < o.y;
    return x < o.x;
  }
} b[N];
ll px, py;
ll c[N], d[N];
void mov(char dir, ll dis) {
  ll nx = px, ny = py;
  if (dir == 'R')
    nx += dis;
  else if (dir == 'L')
    nx -= dis;
  else if (dir == 'U')
    ny += dis;
  else
    ny -= dis;
  if (dir == 'R' || dir == 'L') {
    // ny == py, search by sy
    Sy p1{px, py}, p2{nx, ny};
    if (p2 < p1) swap(p1, p2);
    int l = lower_bound(b + 1, b + n + 1, p1) - b;
    int r = upper_bound(b + 1, b + n + 1, p2) - b;
    d[l]++, d[r]--;
  } else {
    // nx == px, search by sx
    Sx p1{px, py}, p2{nx, ny};
    if (p2 < p1) swap(p1, p2);
    int l = lower_bound(a + 1, a + n + 1, p1) - a;
    int r = upper_bound(a + 1, a + n + 1, p2) - a;
    c[l]++, c[r]--;
  }
  px = nx, py = ny;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> px >> py;
  rep(i, 1, n) {
    ll x, y;
    cin >> x >> y;
    a[i] = Sx{x, y}, b[i] = Sy{x, y};
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  while (m--) {
    char dir;
    ll dis;
    cin >> dir >> dis;
    mov(dir, dis);
  }
  using pll = pair<ll, ll>;
  set<pll> st;
  rep(i, 1, n) {
    c[i] = c[i - 1] + c[i];
    if (c[i]) st.insert(pll(a[i].x, a[i].y));
    d[i] = d[i - 1] + d[i];
    if (d[i]) st.insert(pll(b[i].x, b[i].y));
  }
  cout << px << ' ' << py << ' ' << st.size();
  return 0;
}